package com.da.javatest.demo.basic;

/**
 * @author chenlida
 * @date 2019/12/13 10:44
 * @description
 */
public class Load2 {
    private Load2() {
        System.out.println("Load2初始化");
    }

    public static synchronized Load2 getInstance() {
        return SingletonInstance.INSTANCE;
    }

    private static class SingletonInstance {
        private static final Load2 INSTANCE = new Load2();
    }

    public static void main(String[] args) {
        System.out.println("aaa");
        Load2 instance1 = getInstance();
        Load2 instance2 = getInstance();
        System.out.println(instance1.hashCode());
        System.out.println(instance2.hashCode());

    }
}
